﻿using Juli.Mes.MongoDb.Interface;
using Juli.Mes.MongoDb.Repositories;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Modularity;

namespace Juli.Mes.MongoDb
{
    public class MesMongoDbModule: AbpModule
    {
        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            var configuration = context.Services.GetConfiguration();
            var connectionString = configuration.GetValue<string>("MongoSettings:Connection");
            var dataBaseName = configuration.GetValue<string>("MongoSettings:DatabaseName");

            context.Services.AddSingleton<IMongoConnection,MongoConnection>();
            context.Services.AddScoped<IMongoContext, MongoContext>();
            context.Services.AddScoped<IUnitOfWork, UnitOfWork>();
            context.Services.AddScoped<IUserRepository, UserRepository>();
          //  context.Services.AddScoped<ITelemetryRepository, TelemetryRepository>();
        }
    }
}
